<?php

class Example_Controller_Home
    extends Example_Controller
{

    public function __construct(array $args = array( ))
    {

        $title = null;

        $loop = new OOWP_Loop(array(
            'article_class' => 'Example_Element_Article_Excerpt_Post',
        ));

        $nav_below = new OOWP_Element_Nav(array(
            'attributes' => array(
                'class' => array(
                    'clearfix',
                    'grid_12',
                ),
                'id' => 'nav-below',
     	    ),   
            'contents' => array(
                new OOWP_Element(array(
                    'attributes' => array(
                        'class' => array('pagination'),
                    ),
                    'contents' => array(new OOWP_Atom_PaginateLinks( ))
                )),
            ),
        )); // nav-below

        $main = new Example_Element_Site_Main(array(
            'contents' => array(
                'nav_above' => $nav_above,
                'title' => null,
                'loop' => $loop,
                'nav_below' => $nav_below,
            ),
        ));

        $input = array_merge(array(
            'body' => new Example_Element_Site_Body(array(
                'contents' => array(
                    'main' => $main,
                ),
            )),
        ), $args);

        parent::__construct($input);
    }

    public static function matches(WP_Query $query)
    {
        if ($query->is_home) {
            return true;
        }
        return false;
    }
}
